import React from "react";
import styles from '../index.module.scss';
import {isEmpty} from "lodash";
import {FormBox} from '@/components/FormLayout';
import dvTool from "@/pages/dv/dvTool";
import {EE} from "@/utils";

interface IProps {
  selectedChartKey?: string;
  advanceConfig?: any,
}

interface IState {
  advanceConfig: any,
}

export default class CommonPanel extends React.PureComponent<IProps, IState> {
  public form: any;
  public advanceConfig: DV.IAdvanceConfig;

  constructor(props: IProps) {
    super(props);
    this.advanceConfig = props.advanceConfig;
  }


  componentDidMount(): void {

  }


  getBaseFields(){
    return []
  }

  onValuesChange(changedValues: IBaseConfig, allValues: object) {
    // dvTool.updateBaseConfig(uid, changedValues)
  }

  render() {

    return <div className={styles.chartPanelContent + ' scrollbar_theme'}>
      <FormBox
        fields={this.getBaseFields()}
        initialValues={this.advanceConfig.option}
        onValuesChange={this.onValuesChange}
        getForm={(form: any) => this.form = form }
      />
    </div>;
  }
}
